﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<base href="<%=basePath%>">
<!-- 下拉框 -->
<link rel="stylesheet" href="static/ace/css/chosen.css" />
<!-- jsp文件头和头部 -->
<%@ include file="../index/top.jsp"%>
<!-- 日期框 -->
<link rel="stylesheet" href="static/ace/css/datepicker.css" />
<style>
td{white-space: nowrap;}

</style>
</head>

<body class="no-skin">

	<!-- /section:basics/navbar.layout -->
	<div class="main-container" id="main-container">
		<!-- /section:basics/sidebar -->
		<div class="main-content">
			<div class="main-content-inner">
				<div class="page-content">
					<div class="row">
						<div class="col-xs-12">
						
						<!-- 检索  -->
						<form action="config/aliyunList.do" method="post" name="goodsForm" id="goodsForm">
						     <table id="simple-table" class="table table-striped table-bordered table-hover"  style="margin-top:5px;table-layout:fixed" >
							  <thead>
							  
								<tr>
									<th class="center" >排序</th>
									<th class="center" >应用ID</th>
                                    <th class="center" >服务</th> 
                                    <th class="center" >支付金额</th> 
                                    <th class="center" >状态</th> 
                                    <th class="center" >操作</th> 
								</tr>
							</thead>
													
							<tbody>
							<!-- 开始循环 -->	
							<c:choose>
								<c:when test="${not empty aliList}">
									<c:if test="${QX.cha == 1 }">
									<c:forEach items="${aliList}" var="con" varStatus="vs">
												
										<tr>
										<td class='center' style="width: 30px;">${vs.index+1}</td>
										<td class="center">${con.app_id }</td>
										<td class="center"><c:if test="${con.pay_value=='00'}"><span class="label label-success arrowed">测试</span></c:if><c:if test="${con.pay_value=='01'}"><span class="label label-success arrowed">生产</span></c:if></td>
                                        <td class="center"><c:if test="${con.pay_value=='00'}">1分钱</c:if><c:if test="${con.pay_value=='01'}">正常</c:if></td>
                                        <td style="width: 60px;" class="center">
                                            <c:if test="${con.state == '01' }">
                                            <span class="label label-success arrowed">启用中</span>
                                          </c:if> 
                                          <c:if test="${con.state == '00' }">
                                            <span class="label label-important arrowed-in">停用中</span>
                                          </c:if>
                                        </td>
                                        <td class="center">
                                        <c:if test="${QX.edit != 1 && QX.del != 1 }">
											<span
												class="label label-large label-grey arrowed-in-right arrowed-in"><i
												class="ace-icon fa fa-lock" title="无权限"></i></span>
										</c:if>
										<div class="hidden-sm hidden-xs btn-group">
											
											<c:if test="${QX.edit == 1 }">
												<c:if test="${con.state =='01' }">
													<a class="btn btn-xs" title="停用"
														onclick="delUser('${con.id }','00');"> <i
														class="ace-icon fa fa-lock bigger-120"
														title="停用"></i>
													</a>
												</c:if>
												<c:if test="${con.state =='00' }">
													<a class="btn btn-xs btn-success" title="启用"
														onclick="delUser('${con.id}','01');"> <i
														class="ace-icon fa fa-unlock bigger-120"
														title="启用"></i>
													</a>
												</c:if>
											</c:if>
											
										</div>
										<div class="hidden-md hidden-lg">
											<div class="inline pos-rel">
												<button
													class="btn btn-minier btn-primary dropdown-toggle"
													data-toggle="dropdown" data-position="auto">
													<i class="ace-icon fa fa-cog icon-only bigger-110"></i>
												</button>
												<ul
													class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
												
												
												</ul>
											</div>
										</div></td>
										</tr> 
									</c:forEach>
									</c:if>
									<c:if test="${QX.cha == 0 }">
										<tr>
											<td colspan="6" class="center">您无权查看</td>
										</tr>
									</c:if>
								</c:when>
								<c:otherwise>
									<tr class="main_info">	
										<td colspan="6" class="center">没有相关数据</td>
									</tr>
								</c:otherwise>
							</c:choose>
							</tbody>
						</table>
            <table style="width:100%;">
            <tr>
                <td style="vertical-align:top;">
                  <c:if test="${QX.add == 1 }">
                  <a class="btn btn-mini btn-success" onclick="add();">新增</a>
                  </c:if>
                </td>
                <td style="vertical-align:top;"><div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div></td>
              </tr>
          </table>
					</form>
	
						</div>
						<!-- /.col -->
					</div>
					<!-- /.row -->
				</div>
				<!-- /.page-content -->
			</div>
		</div>
		<!-- /.main-content -->

		<!-- 返回顶部 -->
		<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
			<i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
		</a>

	</div>
	<!-- /.main-container -->

	<!-- basic scripts -->
	<!-- 页面底部js¨ -->
	<%@ include file="../index/foot.jsp"%>
	<!-- 删除时确认窗口 -->
	<script src="static/ace/js/bootbox.js"></script>
	<!-- ace scripts -->
	<script src="static/ace/js/ace/ace.js"></script>
	<!-- 日期框 -->
	<script src="static/ace/js/date-time/bootstrap-datepicker.js"></script>
	<!-- 下拉框 -->
	<script src="static/ace/js/chosen.jquery.js"></script>
	<!--提示框-->
	<script type="text/javascript" src="static/js/jquery.tips.js"></script>
	</body>

<script type="text/javascript">
$(top.hangge());
//检索
function delUser(id,state){
			var msg="";
			if(state=="01"){
				msg="启用";
			}else{
				msg="停用";
			}
			bootbox.confirm("确定要"+msg+"吗?", function(result) {
				if(result) {
					top.jzts();
					var url = "<%=basePath%>config/updateAliPay?ID="+id+"&state="+state;
					$.get(url,function(data){
						if(data=="1"){
							alert("修改成功");
						}
						else{
							alert("修改失败");
						}
						nextPage('1');
					});
				}
			});
		}
		
function add(){
	 top.jzts();
	 var diag = new top.Dialog();
	 diag.Drag=true;
	 diag.Title ="新增阿里云支付配置";
	 diag.URL = '<%=basePath%>config/goAddAli.do';
	 diag.Width = 1100;
	 diag.Height = 700;
	 diag.CancelEvent = function(){ //关闭事件
		 if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
			 if('${page.currentPage}' == '0'){
				 top.jzts();
				 setTimeout("self.location=self.location",100);
			 }else{
				 nextPage('${page.currentPage}');
			 }
		}
		diag.close();
	 };
	 diag.show();
}
</script>
</html>
